package com.cyh.testdesignpattern.template;

import android.util.Log;

//豆浆
public abstract class SoyaMilk {
    //模板方法，作为final,不让子类去覆盖
    final  public void make() {
        select();
        if(isCondiments()) {
            addCondiments();
        }
        soak();
        beat();
    }
    //选材
    void select() {
        Log.i("SoyaMilk", "---select");
    }
    //加调料
    abstract void addCondiments();

    boolean isCondiments() {
        return true;
    }

    //浸泡
    void soak() {
        Log.i("SoyaMilk", "---soak");
    }
    //打碎
    void beat() {
        Log.i("SoyaMilk", "---beat");
    }
}
